package org.aphasia4j.service.impl;

import java.util.List;

import org.aphasia4j.dao.core.BaseDao;
import org.aphasia4j.model.Model;
import org.aphasia4j.service.BaseService;
import org.springframework.transaction.annotation.Transactional;

/**
 * Interface description for service related requests.
 * 
 * @author hillger.t
 */
public class BaseServiceImpl<D extends BaseDao<T>, T extends Model> implements BaseService<D, T> {
  protected D dao;

  public void setDao(D dao) {
    this.dao = dao;
  }

  @Override
  public void persist(T obj) {
    this.dao.persist(obj);
  }

  @Override
  public void remove(T obj) {
    this.dao.remove(obj);
  }

  @Override
  public void remove(long id) {
    this.dao.remove(id);
  }

  @Override
  public T get(long id) {
    return this.dao.get(id);
  }

  @Override
  public List<T> getAll() {
    return this.dao.findAll();
  }
}
